package com.itheima.mapper;


import com.itheima.common.pojo.Order;
import com.itheima.common.pojo.OrderSetting;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;

@Mapper
public interface OrderMapper {
    /**
     * 根据预约日期查询预约设置信息
     */
    OrderSetting findByOrderDate(Date orderDate);

    /**
     * 根据条件查询预约信息
     */
    Order findByCondition(@Param("orderDate") Date orderDate,
                         @Param("setmealId") Integer setmealId);

    /**
     * 提交预约订单
     */
    void submitOrder(Order order);

    /**
     * 更新已预约人数
     */
    void updateReservations(OrderSetting orderSetting);
}
